<div class="form-group">
    <label class="col-lg control-label must">商户名称</label>
    <div class="col-sm-8">
        <input type="text" class="form-control" name="merchname" value="{$item['merchname']}" data-rule-required="true"/>
    </div>
</div>
{if !empty($member)}
<div class="form-group">
    <label class="col-lg control-label">昵称</label>
    <div class="col-sm-8">
        <div class="form-control-static"><a target="_blank" href="{:url('admin/member/detail',array('id'=>$member['id']))}"> {$member['nickname']}</a></div>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">mid</label>
    <div class="col-sm-8">
        <div class="form-control-static">{$item['mid']}</div>
    </div>
</div>
{/if}

<div class="form-group">
    <label class="col-lg control-label">商户logo</label>
    <div class="col-sm-9 col-xs-12">
        {:tpl_form_field_image2('logo',$item['logo'],'/public/static/images/nopic.jpg')}
        <span class="help-block">商户logo 建议尺寸 300 * 300</span>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label must">主营项目</label>
    <div class="col-sm-8">
        <input type="text" class="form-control" name="salecate" value="{$item['salecate']}" data-rule-required="true"/>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label must">商户分类</label>
    <div class="col-sm-8">
        <select class="form-control" name="cateid" required>
            {foreach name='category' item='c'}
            <option value="{$c['id']}" {if $item['cateid']==$c['id']}selected{/if}>{$c['catename']}</option>
            {/foreach}
        </select>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label must">联系人</label>
    <div class="col-sm-8">
        <input type="text" class="form-control" name="realname" value="{$item['realname']}" data-rule-required="true"/>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label must">联系电话</label>
    <div class="col-sm-8">
        <input type="tel" class="form-control" name="mobile" value="{$item['mobile']}" data-rule-required="true"/>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">商户简介</label>
    <div class="col-sm-8">
        <textarea name="desc1" class="form-control textarea">{$item['desc']}</textarea>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">商户地址</label>
    <div class="col-sm-9 col-xs-12">
        <input type="text" name="address" class="form-control" value="{$item['address']}" />
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">商户电话</label>
    <div class="col-sm-9 col-xs-12">
        <input type="text" name="tel" class="form-control" value="{$item['tel']}" />
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">商户位置</label>
    <div class="col-sm-9 col-xs-12">
        {:tpl_form_field_position('map',array('lng'=>$item['lng'],'lat'=>$item['lat']))}
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">是否推荐</label>
    <div class="col-sm-9 col-xs-12">
        <label class="radio-inline">
            <input type="radio" name='isrecommand' value="1" {if $item['isrecommand']==1}checked{/if} /> 是
        </label>
        <label class="radio-inline">
            <input type="radio" name='isrecommand' value="0" {if empty($item['isrecommand'])}checked{/if} /> 否
        </label>
    </div>
</div>
<div class="form-group-title">帐号信息</div>
<div class="form-group">
    <label class="col-lg control-label">主账户名</label>
    <div class="col-sm-8">
        <input type="text" class="form-control" name="username" value="{if !empty($account['username'])}{$account['username']}{else}{$show_name}{/if}" />
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">主账户密码</label>
    <div class="col-sm-8">
        <input type="text" class="form-control" name="pwd" value="{if !empty($account['pwd'])}{else}{$show_pass}{/if}"/>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">子账户数量</label>
    <div class="col-sm-8">
        <input type="num" class="form-control" name="accounttotal" value="{$item['accounttotal']}"/>
        <span class="help-block">商户可以创建的子管理帐号个数，默认不能创建</span>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">商品数量</label>
    <div class="col-sm-8">
        <input type="num" class="form-control" name="maxgoods" value="{$item['maxgoods']}"/>
        <span class="help-block">商户可以创建的商品个数</span>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">服务到期时间</label>
    <div class="col-sm-8">
        {:tpl_form_field_date('accounttime',$accounttime)}
        <span class="help-block">商户账户有效期限</span>
    </div>
</div>
<div class="form-group-title">商户权限组</div>
<div class="form-group">
    <label class="col-lg control-label must">商户组</label>
    <div class="col-sm-8">
        <select class="form-control" name="groupid" required>
            {foreach name='groups' item='g'}
            <option value="{$g['id']}" {if $item['groupid']==$g['id']}selected{/if}>{$g['groupname']}</option>
            {/foreach}
        </select>
    </div>
</div>

<div class="form-group-title">商户备注</div>
<div class="form-group">
    <label class="col-lg control-label">商户备注</label>
    <div class="col-sm-8">
        <textarea name="remark" class="form-control textarea">{$item['remark']}</textarea>
    </div>
</div>

<div class="form-group-title">入驻状态</div>
<div class="form-group">
    <label class="col-lg control-label">状态</label>
    <div class="col-sm-8">
        {if !empty($item) && $item['status']<=0}
        <label class="radio-inline">
            <input type="radio" name="status" value="0" {if $item['status']==0}checked{/if} /> 待入驻
        </label>
        {/if}
        <label class="radio-inline">
            <input type="radio" name="status" value="1" {if $item['status']==1}checked{/if} />允许入驻
        </label>
        <label class="radio-inline">
            <input type="radio" name="status" value="2" {if $item['status']==2}checked{/if}/> 暂停中
        </label>
    </div>
</div>

<div class="form-group-title">商户结算</div>
<div class="form-group">
    <label class="col-lg control-label">抽成比例</label>
    <div class="col-sm-8">
        <div class="input-group">
            <input type="text" class="form-control" name="payrate" value="{$item['payrate']}" /><span class="input-group-addon">%</span>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label must">收款人</label>
    <div class="col-sm-8">
        {:tpl_selector('paymid',array('required'=>false,'preview'=>false,'key'=>'id','text'=>'nickname','type'=>'text','placeholder'=>'昵称/姓名/手机号','buttontext'=>'选择收款人 ', 'items'=>$user,'url'=>url('admin/member/query') ))}
    </div>
</div>
<div class="form-group-title">多商户积分商城积分订单提现</div>
<div class="form-group">
    <label class="col-lg control-label">积分商城提现</label>
    <div class="col-sm-8">
        <div class="input-group">
            <label class="radio-inline">
                <input type="radio" name="iscredit" value="0" {if empty($item['iscredit'])}checked{/if} /> 开启            
            </label>
            <label class="radio-inline">
                <input type="radio" name="iscredit" value="1" {if !empty($item['iscredit'])}checked{/if} />禁用
            </label>
        </div>
        <span class="help-block">如果开启积分商城提现功能，商户积分商城的订单将可以通过余额进行提现。</span>
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">积分兑换</label>
    <div class="col-sm-8">
        <div class="input-group">
            <label class="radio-inline">
                <input type="radio" name="iscreditmoney" value="0" {if empty($item['iscreditmoney'])}checked{/if} /> 开启
            </label>
            <label class="radio-inline">
                <input type="radio" name="iscreditmoney" value="1" {if !empty($item['iscreditmoney'])}checked{/if} />禁用
            </label>
        </div>
        <span class="help-block">如果开启积分兑换功能，商户积分商城的订单中的积分将可以通过积分兑换余额进行提现。</span>
    </div>
</div>
<!--    -->

<div id="seecredit">
    <div class="form-group">
        <label class="col-lg control-label">兑换比例</label>
        <div class="col-sm-8">
            <div class="input-group">
                <input type="text" class="form-control" name="creditrate" value="{$item['creditrate']}" /><span class="input-group-addon">积分：1元</span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-lg control-label must">收款人</label>
        <div class="col-sm-8">
            <div class="form-control-static">与商户结算收款人为同一人</div>
        </div>
    </div>
</div>